import jinja2 as jj2
import pathlib


__g_libs_dir_path = pathlib.Path(__file__).parent.absolute()


def get_libs_dir_path():
    return __g_libs_dir_path


def create_jj2_env(searchpath):
    return jj2.Environment(loader=jj2.FileSystemLoader(searchpath))


def create_jj2_env_libs():
    return create_jj2_env(__g_libs_dir_path)


def create_jj2_env_components():
    return create_jj2_env(__g_libs_dir_path / 'components')
